package com.wiyun.engine.skeleton;

import java.io.IOException;

import android.content.res.AssetManager;
import android.view.MotionEvent;

import com.wiyun.engine.nodes.Director;
import com.wiyun.engine.nodes.Layer;
import com.wiyun.engine.types.WYPoint;
import com.wiyun.engine.types.WYSize;

public class TempLayer extends Layer {
	MainLayer _mainLayer;
	public TempLayer(AssetManager am, MainLayer mainLayer) throws IOException
	{
		setTouchEnabled(true);

		_mainLayer=mainLayer;
	}
	@Override
    public boolean wyTouchesBegan(MotionEvent event) {
     	WYPoint loc = Director.getInstance().convertToGL(event.getX(), event.getY());
     	float mainLayerPosX=_mainLayer.getPositionX();
     	float mainlayerPosY=_mainLayer.getPositionY();
     	_mainLayer.RunPlayer(loc.x-mainLayerPosX, loc.y-mainlayerPosY);
		return true;
	}
}
